<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>LEvent</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="icon" href="../assets/favicon.ico">
    <script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">

<div id="doc">
    <div id="hd" class="yui3-g header">
        <div class="yui3-u-3-4">
                <h1><img src="../assets/css/logo.png" title="" width="117" height="52"></h1>
        </div>
        <div class="yui3-u-1-4 version">
            <em>API Docs for: </em>
        </div>
    </div>
    <div id="bd" class="yui3-g">

        <div class="yui3-u-1-4">
            <div id="docs-sidebar" class="sidebar apidocs">
                <div id="api-list">
                    <h2 class="off-left">APIs</h2>
                    <div id="api-tabview" class="tabview">
                        <ul class="tabs">
                            <li><a href="#api-classes">Classes</a></li>
                            <li><a href="#api-modules">Modules</a></li>
                        </ul>
                
                        <div id="api-tabview-filter">
                            <input type="search" id="api-filter" placeholder="Type to filter APIs">
                        </div>
                
                        <div id="api-tabview-panel">
                            <ul id="api-classes" class="apis classes">
                                <li><a href="../classes/BBox.html">BBox</a></li>
                                <li><a href="../classes/geo.html">geo</a></li>
                                <li><a href="../classes/GL.html">GL</a></li>
                                <li><a href="../classes/gl.html">gl</a></li>
                                <li><a href="../classes/GL.Buffer.html">GL.Buffer</a></li>
                                <li><a href="../classes/GL.FBO.html">GL.FBO</a></li>
                                <li><a href="../classes/GL.Indexer.html">GL.Indexer</a></li>
                                <li><a href="../classes/GL.Mesh.html">GL.Mesh</a></li>
                                <li><a href="../classes/GL.Octree.html">GL.Octree</a></li>
                                <li><a href="../classes/GL.Shader.html">GL.Shader</a></li>
                                <li><a href="../classes/GL.Texture.html">GL.Texture</a></li>
                                <li><a href="../classes/LEvent.html">LEvent</a></li>
                            </ul>
                
                
                            <ul id="api-modules" class="apis modules">
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="yui3-u-3-4">
                <div id="api-options">
                    Show:
                    <label for="api-show-inherited">
                        <input type="checkbox" id="api-show-inherited" checked>
                        Inherited
                    </label>
            
                    <label for="api-show-protected">
                        <input type="checkbox" id="api-show-protected">
                        Protected
                    </label>
            
                    <label for="api-show-private">
                        <input type="checkbox" id="api-show-private">
                        Private
                    </label>
                    <label for="api-show-deprecated">
                        <input type="checkbox" id="api-show-deprecated">
                        Deprecated
                    </label>
            
                </div>
            
            <div class="apidocs">
                <div id="docs-main">
                    <div class="content">
<h1>LEvent Class</h1>
<div class="box meta">


        <div class="foundat">
            Defined in: <a href="../files/.._src_levent.js.html#l5"><code>..&#x2F;src&#x2F;levent.js:5</code></a>
        </div>


</div>


<div class="box intro">
    <p>LEvent is a lightweight events library focused in low memory footprint and fast delivery.
It works by creating a property called &quot;__levents&quot; inside the object that has the bindings, and storing arrays with all the bindings.</p>

</div>

    <div class="constructor">
        <h2>Constructor</h2>
<div id="method_LEvent" class="method item">
    <h3 class="name"><code>LEvent</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_levent.js.html#l5"><code>..&#x2F;src&#x2F;levent.js:5</code></a>
        </p>



    </div>

    <div class="description">
        
    </div>




</div>
    </div>

<div id="classdocs" class="tabview">
    <ul class="api-class-tabs">
        <li class="api-class-tab index"><a href="#index">Index</a></li>

            <li class="api-class-tab methods"><a href="#methods">Methods</a></li>
    </ul>

    <div>
        <div id="index" class="api-class-tabpanel index">
            <h2 class="off-left">Item Index</h2>

                <div class="index-section methods">
                    <h3>Methods</h3>

                    <ul class="index-list methods">
                            <li class="index-item method">
                                <a href="#method_LEvent.bind">LEvent.bind</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_LEvent.extendClass">LEvent.extendClass</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_LEvent.hasBind">LEvent.hasBind</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_LEvent.hasBindTo">LEvent.hasBindTo</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_LEvent.isBind">LEvent.isBind</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_LEvent.trigger">LEvent.trigger</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_LEvent.triggerArray">LEvent.triggerArray</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_LEvent.unbind">LEvent.unbind</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_LEvent.unbindAll">LEvent.unbindAll</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_LEvent.unbindAll">LEvent.unbindAll</a>

                            </li>
                    </ul>
                </div>



        </div>

            <div id="methods" class="api-class-tabpanel">
                <h2 class="off-left">Methods</h2>

<div id="method_LEvent.bind" class="method item">
    <h3 class="name"><code>LEvent.bind</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>instance</code>
                </li>
                <li class="arg">
                        <code>event_name</code>
                </li>
                <li class="arg">
                        <code>callback</code>
                </li>
                <li class="arg">
                        <code>target_instance</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_levent.js.html#l14"><code>..&#x2F;src&#x2F;levent.js:14</code></a>
        </p>



    </div>

    <div class="description">
        <p>Binds an event to an instance</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">instance</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        <p>where to attach the event</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">event_name</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        <p>string defining the event name</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">callback</code>
                        <span class="type">Function</span>


                    <div class="param-description">
                        <p>function to call when the event is triggered</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">target_instance</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        <p>[Optional] instance to call the function (use this instead of .bind method to help removing events)</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_LEvent.extendClass" class="method item">
    <h3 class="name"><code>LEvent.extendClass</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>constructor</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_levent.js.html#l381"><code>..&#x2F;src&#x2F;levent.js:381</code></a>
        </p>



    </div>

    <div class="description">
        <p>Adds the methods to bind, trigger and unbind to this class prototype</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">constructor</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_LEvent.hasBind" class="method item">
    <h3 class="name"><code>LEvent.hasBind</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>instance</code>
                </li>
                <li class="arg">
                        <code>event_name</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Boolean</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_levent.js.html#l175"><code>..&#x2F;src&#x2F;levent.js:175</code></a>
        </p>



    </div>

    <div class="description">
        <p>Tells if there is any callback binded to this event</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">instance</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        <p>where the are the events binded</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">event_name</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        <p>string defining the event name</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Boolean</span>:
                    <p>true is there is at least one</p>

            </div>
        </div>


</div>
<div id="method_LEvent.hasBindTo" class="method item">
    <h3 class="name"><code>LEvent.hasBindTo</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>instance</code>
                </li>
                <li class="arg">
                        <code>target</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Boolean</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_levent.js.html#l192"><code>..&#x2F;src&#x2F;levent.js:192</code></a>
        </p>



    </div>

    <div class="description">
        <p>Tells if there is any callback binded to this object pointing to a method in the target object</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">instance</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        <p>where there are the events binded</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">target</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        <p>instance to check to</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Boolean</span>:
                    <p>true is there is at least one</p>

            </div>
        </div>


</div>
<div id="method_LEvent.isBind" class="method item">
    <h3 class="name"><code>LEvent.isBind</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>instance</code>
                </li>
                <li class="arg">
                        <code>event_name</code>
                </li>
                <li class="arg">
                        <code>callback</code>
                </li>
                <li class="arg">
                        <code>target_instance</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_levent.js.html#l146"><code>..&#x2F;src&#x2F;levent.js:146</code></a>
        </p>



    </div>

    <div class="description">
        <p>Tells if there is a binded callback that matches the criteria</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">instance</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        <p>where the are the events binded</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">event_name</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        <p>string defining the event name</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">callback</code>
                        <span class="type">Function</span>


                    <div class="param-description">
                        <p>the callback</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">target_instance</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        <p>[Optional] instance binded to callback</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_LEvent.trigger" class="method item">
    <h3 class="name"><code>LEvent.trigger</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>instance</code>
                </li>
                <li class="arg">
                        <code>event_name</code>
                </li>
                <li class="arg">
                        <code>parameters</code>
                </li>
                <li class="arg">
                        <code>reverse_order</code>
                </li>
                <li class="arg">
                        <code>expand_parameters</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_levent.js.html#l222"><code>..&#x2F;src&#x2F;levent.js:222</code></a>
        </p>



    </div>

    <div class="description">
        <p>Triggers and event in an instance
If the callback returns true then it will stop the propagation and return true</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">instance</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        <p>that triggers the event</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">event_name</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        <p>string defining the event name</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">parameters</code>
                        <span class="type"></span>


                    <div class="param-description">
                        <p>that will be received by the binded function</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">reverse_order</code>
                        <span class="type">Bool</span>


                    <div class="param-description">
                        <p>trigger in reverse order (binded last get called first)</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">expand_parameters</code>
                        <span class="type">Bool</span>


                    <div class="param-description">
                        <p>parameters are passed not as one single parameter, but as many
return {bool} true if the event passed was blocked by any binded callback</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_LEvent.triggerArray" class="method item">
    <h3 class="name"><code>LEvent.triggerArray</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>array</code>
                </li>
                <li class="arg">
                        <code>event_name</code>
                </li>
                <li class="arg">
                        <code>parameters</code>
                </li>
                <li class="arg">
                        <code>reverse_order</code>
                </li>
                <li class="arg">
                        <code>expand_parameters</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_levent.js.html#l283"><code>..&#x2F;src&#x2F;levent.js:283</code></a>
        </p>



    </div>

    <div class="description">
        <p>Triggers and event to every element in an array.
If the event returns true, it must be intercepted</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">array</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>contains all instances to triggers the event</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">event_name</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        <p>string defining the event name</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">parameters</code>
                        <span class="type"></span>


                    <div class="param-description">
                        <p>that will be received by the binded function</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">reverse_order</code>
                        <span class="type">Bool</span>


                    <div class="param-description">
                        <p>trigger in reverse order (binded last get called first)</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">expand_parameters</code>
                        <span class="type">Bool</span>


                    <div class="param-description">
                        <p>parameters are passed not as one single parameter, but as many
return {bool} false</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_LEvent.unbind" class="method item">
    <h3 class="name"><code>LEvent.unbind</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>instance</code>
                </li>
                <li class="arg">
                        <code>event_name</code>
                </li>
                <li class="arg">
                        <code>callback</code>
                </li>
                <li class="arg">
                        <code>target_instance</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_levent.js.html#l46"><code>..&#x2F;src&#x2F;levent.js:46</code></a>
        </p>



    </div>

    <div class="description">
        <p>Unbinds an event from an instance</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">instance</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        <p>where the event is binded</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">event_name</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        <p>string defining the event name</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">callback</code>
                        <span class="type">Function</span>


                    <div class="param-description">
                        <p>function that was binded</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">target_instance</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        <p>[Optional] target_instance that was binded</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_LEvent.unbindAll" class="method item">
    <h3 class="name"><code>LEvent.unbindAll</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>instance</code>
                </li>
                <li class="arg">
                        <code>target_instance</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_levent.js.html#l87"><code>..&#x2F;src&#x2F;levent.js:87</code></a>
        </p>



    </div>

    <div class="description">
        <p>Unbinds all events from an instance (or the ones that match certain target_instance)</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">instance</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        <p>where the events are binded</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">target_instance</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        <p>[Optional] target_instance of the events to remove</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_LEvent.unbindAll" class="method item">
    <h3 class="name"><code>LEvent.unbindAll</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>instance</code>
                </li>
                <li class="arg">
                        <code>event</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_levent.js.html#l126"><code>..&#x2F;src&#x2F;levent.js:126</code></a>
        </p>



    </div>

    <div class="description">
        <p>Unbinds all callbacks associated to one specific event from this instance</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">instance</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        <p>where the events are binded</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">event</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        <p>name of the event you want to remove all binds</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
            </div>



    </div>
</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
